<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAuthTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('auth', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->unique();
            $table->integer('icon_id')->unsigned();
            $table->string('href')->unique();
            $table->tinyInteger('spread')->default(0);
            $table->integer('level');
            $table->string('module');
            $table->tinyInteger('limit')->default(0);
            $table->tinyInteger('gadget')->default(0);
            $table->foreign('icon_id')->references('id')->on('icon');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('auth');
    }
}
